package com.spring.primary_demo;

import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

/**
 * 若没有添加@Primary，则报错
 * No qualifying bean of type 'com.spring.primary_demo.IMyService'
 * available: expected single matching bean but found 2: myService001,myService002
 */
@Component
@Primary
public class MyService001 implements IMyService{


	public void sayhi(){
		System.out.println("hello1 -->");
	}
}
